home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / m68k / 206 < prev    next >
Encoding:
Text File  |  1996-08-05  |  3.2 KB  |  62 lines

  1. Newsgroups: comp.sys.m68k
  2. Path: netcom.com!ludis
  3. From: ludis@netcom.com (Ludis Langens)
  4. Subject: Re: Interfacing Z80 periphs to a 68k system
  5. Message-ID: <ludisDM70r7.Hzs@netcom.com>
  6. Organization: It's here somewhere
  7. References: <4eg3k1$dc5@elektron.et.tudelft.nl> <4etqpg$re4@simancas.cpd.uva.es>
  8. Date: Sat, 3 Feb 1996 09:23:31 GMT
  9. Sender: ludis@netcom13.netcom.com
  10.  
  11. In article <4etqpg$re4@simancas.cpd.uva.es> jesus@simu1.ele.cie.uva.es () writes:
  12. >jan-derk bakker (bakker@morra.et.tudelft.nl) wrote:
  13. >: As the MC68901 is off the market, and the replacement 'HC901 hasn't
  14. >: been introduced yet, I was thinking about connecting a Z8090 aka
  15. >: Z80 KIO to my 68020 system. At under $10, this part offers two serial
  16. >: ports, 16 I/O bits, 3 timers and some more stuff in a 84-pin PLCC
  17. >: package.
  18. >:  
  19. >: The programming of this chip shouldn't be too hard (I have all the
  20. >: Zilog manuals left over from my last life). However, I still have to
  21. >: connect the chip, which means getting the timing right :-(.
  22. >: It doesn't seem to be too hard (from the manual), but I am still
  23. >: *very* interested to hear from anyone who has attempted this unusual
  24. >: combination before.
  25. >
  26. >I don't know this chip, but i'm thinking about this interfacing for some
  27. >time (I want a 68k + Z80 SIO), and i think that the main problem comes from
  28. >the End of Interrupt Ack. The Zilog peripherals listen to the data bus in
  29. >search of the RETI op, that signals the end of interrupt. The line M1 of Z80
  30. >CPU signals the op fetch, but this instruction is 2 bytes long and therefore
  31. >generates 2 machine cycles. Fortunately, the SIO (and probably other Zilog
  32. >IC's) have a Reset Interrupt command to do the same work by software.
  33.  
  34. I'm not familiar with the Z8090, but it sounds like one of the Z8000's
  35. peripheral chips.  This means it has a bus design similar to the 68K and
  36. thus should be easy to interface.  The non-multiplexed (Addr/Data) version
  37. should be easier to interface.  If it exists, the part number is Z8590.
  38.  
  39. The Z8xxx chips can be accessed asyncronously with regard to their clock.
  40. This allows the clock to be any convenient frequency.  The interrupt
  41. structure is also easy to connect to a 68K (in either autovector mode
  42. or full vector mode.)  These chips don't do the funny opcode scanning
  43. of the Z80 series chips.
  44.  
  45. Connecting a Z8xxx to a 68K is not unusual.  Back when the Z8000 CPU
  46. was not getting design wins, and when Motorola couldn't get its 68K
  47. peripheral chips out the door, Zilog advertised its I/O chips for use
  48. with the 68000.  One such system is the Mac - it uses the Z8530 SCC
  49. (aka an enhanced Z80 SIO.)
  50.  
  51. My one timing suggestion is that you include hardware to give the 68K
  52. wait states if it tries to access the 8090 faster than allowed.  In
  53. the original Mac, software had to make sure it waited 2uS between
  54. accesses to the SCC.  Later models generate the delay in hardware -
  55. a NOP at 100MHz doesn't delay much!  (Apple actually used MOVE.W (SP),(SP)
  56. or MOVE.L (SP),(SP) for delays instead of NOPs.)
  57.  
  58. -- 
  59.                    unsigned long BinToBCD(unsigned long i) {unsigned long t;
  60. Ludis Langens         return i ? (t = BinToBCD(i >> 1), (t << 1) + (i & 1) + 
  61. ludis@netcom.com                 (t + 858993459 >> 2 & 572662306) * 3) : 0;}
  62.